package com.pad.pcbuilder;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;










import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Message;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends Activity {
	
	
	
	private final Activity vista = this;
	private boolean dot = false;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		try {
			if (!dot){
				FileOutputStream outputStreamWriter = openFileOutput("config.txt", Context.MODE_PRIVATE | Context.MODE_APPEND);
				outputStreamWriter.close();
				dot = true;
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

    //}

		
		final ImageButton button = (ImageButton) findViewById(R.id.imageButton2);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent intent = new Intent(vista, FirstActivity.class);
            	
            	startActivity(intent);
            }
        });
        
        final ImageButton button2 = (ImageButton) findViewById(R.id.imageButton1);
        button2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent intent = new Intent(vista, ConfgActivity.class);
            	
            	startActivity(intent);
            }
        });
	}
	
	
	
}
